home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / char.3T < prev    next >
Text File  |  1992-06-26  |  7KB  |  200 lines

  1. .TH CHAR
  2. .SH NAME
  3. char*  Auxiliary character string functionality
  4. .SH SYNOPSIS
  5.  #include 
  6. <cool/char.h>
  7. .SH DESCRIPTION
  8. The ANSI C specification requires a collection of standard functions for the manipulation of character strings. However, these do not include some of themore useful functions found in the 
  9.  String 
  10. and 
  11.  Gen_String 
  12. classes. In addtion, many generic character string functions c
  13. an be used for the
  14.  String 
  15. and 
  16.  Gen_String 
  17. objects because of the implicit 
  18.  operator char*\f1. 
  19. For these reasons, the following auxiliary functions are defined for the built-in 
  20.  char* 
  21. data type:
  22. .SH Friend Functions
  23. .TP
  24. \f3Boolean is_equal (const char* \f2str1\f3, const char* \f2str2\f3, Boolean\f2 case_flag\f3 = FALSE);\f1
  25. Compares two character strings for lexical equality. If 
  26.  case_flag 
  27. is 
  28.  
  29.  TRUE, 
  30. a case-sensitive comparison is made; otherwise, a case-insensitive comparison is made. This function returns 
  31.  
  32.  TRUE 
  33. if the strings are lexically equivalent; otherwise, this function returns 
  34.  
  35.  FALSE .
  36. .TP
  37. \f3Boolean is_not_equal (const char* \f2str1\f3, const char* \f2str1\f3, Boolean\f2case_flag\f3 = FALSE);\f1
  38. Compares two character strings for lexical inequality. If 
  39.  case_flag 
  40. is 
  41.  
  42.  TRUE , 
  43. a case-sensitive comparison is made; otherwise, a case-insensitive comparison is made. This function returns 
  44.  
  45.  FALSE 
  46. if the strings are lexically equivalent; otherwise, this function returns 
  47.  
  48.  TRUE .
  49. .TP
  50. \f3Boolean is_equal_n (const char* \f2str1\f3, const char* \f2str1\f3, int \f2n\f3, Boolean \f2case_flag\f3 = FALSE);
  51. Compares 
  52.  n 
  53. characters in two character strings for lexical equality. If 
  54.  case_flag 
  55. is 
  56.  
  57.  TRUE , 
  58. a case-sensitive comparison is made; otherwise, a 
  59. case-insensitive comparison is made. This function returns 
  60.  
  61.  TRUE 
  62. if the strings are lexically equivalent; otherwise, this function returns 
  63.  
  64.  FALSE .
  65. .TP
  66. \f3Boolean is_ge (const char* \f2str1\f3, const char* \f2str2\f3, Boolean \f2case_flag\f3);\f1
  67. This function returns 
  68.  
  69.  TRUE 
  70. if 
  71.  str1 
  72. is lexically greater than or equal to 
  73.  str2 ; 
  74. otherwise, this function returns 
  75.  
  76.  FALSE . 
  77. If 
  78.  case_flag 
  79. is 
  80.  
  81.  TRUE , 
  82. a case-sensitive comparison is made; otherwise, a caseinsensitive comparison is made. 
  83. .TP
  84. \f3Boolean is_gt (const char* \f2str1\f3, const char* \f2str1\f3, Boolean \f2case_flag\f3);\f1
  85. This function returns 
  86.  
  87.  TRUE 
  88. if \f2str1\f1 is lexically greater than \f2str2\f1; otherwise, 
  89. this function returns 
  90.  
  91.  FALSE . 
  92. If \f2case_flag\f1 is 
  93.  
  94.  TRUE , 
  95. a case-sensitive comparison 
  96. is made;  otherwise, a case-insensitive comparison is made. 
  97. .TP
  98. \f3Boolean is_le (const char* \f2str1\f3, const char* \f2str1\f3, Boolean \f2case_flag\f3);\f1
  99. This function returns 
  100.  
  101.  TRUE 
  102. if \f2str1\f1 is lexically less than or equal to \f2str2\f1; 
  103. otherwise, this function returns 
  104.  
  105.  FALSE . 
  106. If \f2case_flag\f1 is 
  107.  
  108.  TRUE , 
  109. a case-sensitive comparison is made; \p
  110. otherwise, a case-insensitive comparison is made. 
  111. .TP
  112. \f3Boolean is_lt (const char* \f2str1\f3, const char* \f2str2\f3, Boolean \f2case_flag\f3);\f1
  113. This function returns 
  114.  
  115.  TRUE 
  116. if \f2str1\f1 is lexically less than \f2str2\f1; otherwise, this 
  117. function returns 
  118.  
  119.  FALSE . 
  120. If the 
  121.  Boolean 
  122. value is 
  123.  
  124.  TRUE , 
  125. a case-sensitive 
  126. comparison is made;  \p 
  127. otherwise, a case-insensitive comparison is made. 
  128. .TP
  129. \f3char* c_capitalize (char* \f2str\f3);\f1
  130. Capitalizes each word and returns a pointer to the modified character string 
  131. \f2str\f1. A word is defined to be any subsequence of alphanumeric characters.
  132. .TP
  133. \f3char* c_downcase (char* \f2str\f3);\f1
  134. Converts any alphabetic character to lowercase. This function returns a pointer 
  135. to the modified character string \f2str\f1.
  136. .TP
  137. \f3char* c_left_trim (char* \f2str1\f3, const char* \f2str2\f3);\f1
  138. Removes any prefix occurrence of the second character string \f2str2\f1 in the first character string \f2sztr1\f1. This function returns a pointer to the modified character string \f2str1\f1.
  139. .TP
  140. \f3char* c_right_trim (char* \f2str1\f3, const char* \f2str2\f3);\f1
  141. Removes any suffix occurrence of the second character string \f2str2\f1 in the first character string \f2str1\f1. This function returns a pointer to the modified character string \f2str1\f1.
  142. .TP
  143. \f3char* c_trim (char* \f2str1\f3, const char* \f2str2\f3);\f1
  144. Removes any occurrence of the second character string \f2str2\f1 from the first 
  145. character string \f2str1\f1. This function returns a pointer to the modified 
  146. character string \f2str1\f1.
  147. .TP
  148. \f3char* c_upcase (char* \f2str\f3);\f1
  149. Converts any alphabetic character to uppercase. This function returns a pointer 
  150. to the modified character string \f2str\f1.
  151. .TP
  152. \f3char* strfind (const char* \f2str1\f3, const char* \f2str2\f3, long& \f2start = 0\f3, long& \f2end = 0\f3);\f1
  153. This function provides simple pattern matching by scanning from left to right 
  154. through \f2str1\f1 for the first occurrence of \f2str2\f1. An asterisk can be used to match for zero or more characters and a question mark can be used to match for any single character. This function returns a pointer to the start of the matching character string and updates the zero-relative \f2start\f1 and \f2end\f1 indexes if found; otherwise, this function returns 
  155.  
  156.  NULL .
  157. .TP
  158. \f3char* strrfind (const char* \f2str1\f3, const char* \f2str2\f3, long& \f2start = 0\f3, long& \f2end = 0\f3);\f1
  159. This function provides simple pattern matching by scanning from right to left 
  160. through \f2str1\f1 for the first occurrence of \f2str2\f1. An asterisk can be used to match for zero or more characters and a question mark can be used to match for any single character. This function returns a pointer to the start of the matching character string and updates the zero-relative \f2start\f1 and \f2end\f1 indexes if found; otherwise, this function returns
  161.  
  162.  NULL .
  163. .TP
  164. \f3char* strndup (const char* \f2str\f3, long \f2position\f3);\f1
  165. Duplicates into a new character string allocated off the heap the sequence of 
  166. characters from the beginning of \f2str\f1 to the zero-relative index \f2position\f1. This function returns a pointer to the duplicated character string if successful; otherwise, this function returns
  167.  
  168.  NULL
  169. if the index is out of range.
  170. .TP
  171. \f3char* strnremove (char* \f2str\f3, long \f2position\f3);\f1
  172. Removes the sequence of characters from the beginning of \f2str\f1 to the  
  173. zero-relative index \f2position\f1. This function returns a pointer to the new 
  174. character string if successful; otherwise, this function returns 
  175.  
  176.  NULL 
  177. if the index is out of range.
  178. .TP
  179. \f3char* stryank (char* \f2str\f3, long \f2position\f3);\f1
  180. Deletes the sequence of characters from the beginning of \f2str\f1 to the 
  181. zero-relative index \f2position\f1 and allocates a new character string off the heap whose value is the deleted characters. This function returns a pointer to the yanked string if successful; otherwise, this function returns 
  182.  
  183.  NULL
  184. if the index is out of range.
  185. .TP
  186. \f3void reverse (char* \f2str\f3);\f1
  187. Reverses the order of characters in a string \f2str\f1.
  188. .SH COPYRIGHT
  189.  
  190. Copyright (C) 1991 Texas Instruments Incorporated.
  191.  
  192. Permission is granted to any individual or institution to use, copy, modify,
  193. and distribute this software, provided that this complete copyright and
  194. permission notice is maintained, intact, in all copies and supporting
  195. documentation.
  196.  
  197. Texas Instruments Incorporated provides this software "as is" without
  198. express or implied warranty.
  199.  
  200.